package cn.bcsp.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Description: TODO
 * @author: wangyue
 * @date: 2021年07月12日 17:43
 */
public class SysUser {
    private long id;
    private String account;
    private String realName;
    private String password;
    private int sex;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    private String phone;
    private String address;
    private long roleId;
    private long createdUserId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createdTime;
    private long updatedUserId;
    private Date updatedTime;
    private int age;
    private String roleName;


    public void setAge(int age) {
        this.age = age;
    }

    private String idPics;

    private String idPics1;

    private String idPics2;

    public String getIdPics1() {
        return idPics1;
    }

    public void setIdPics1(String idPics1) {
        this.idPics1 = idPics1;
    }

    public String getIdPics2() {
        return idPics2;
    }

    public void setIdPics2(String idPics2) {
        this.idPics2 = idPics2;
    }

    public String getIdPics() {
        return idPics;
    }

    public void setIdPics(String idPics) {
        this.idPics = idPics;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public int getAge() {
        return new Date().getYear() - birthday.getYear();
    }


    public SysUser(long id, String account, String realName, String password, int sex, Date birthday, String phone, String address, long roleId, long createdUserId, Date createdTime, long updatedUserId, Date updatedTime) {
        this.id = id;
        this.account = account;
        this.realName = realName;
        this.password = password;
        this.sex = sex;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.roleId = roleId;
        this.createdUserId = createdUserId;
        this.createdTime = createdTime;
        this.updatedUserId = updatedUserId;
        this.updatedTime = updatedTime;
    }

    public SysUser() {
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    public long getCreatedUserId() {
        return createdUserId;
    }

    public void setCreatedUserId(long createdUserId) {
        this.createdUserId = createdUserId;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public long getUpdatedUserId() {
        return updatedUserId;
    }

    public void setUpdatedUserId(long updatedUserId) {
        this.updatedUserId = updatedUserId;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }
}
